package com.example.demo.address.service.impl;


import com.example.demo.address.dao.AddressMapper;
import com.example.demo.address.entity.Address;
import com.example.demo.address.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddreServiceImpl implements AddressService {


    @Autowired
    private AddressMapper addressMapper;

    @Override
    public List<Address> findList(Address address) {

        List<Address> list = addressMapper.findList(address);
        return list;
    }

    @Override
    public Address findOne(String id) {

        Address address = addressMapper.selectByPrimaryKey(id);
        return address;
    }

    @Override
    public void remove(String id) {
        addressMapper.deleteByPrimaryKey(id);

    }

    @Override
    public void save(Address address) {

       addressMapper.insert(address);
    }

    /**
     * 修改订单
     * @param address
     * @返回值 List<address> 用户集合
     */

    @Override
    public void update(Address address) {

        addressMapper.updateByPrimaryKey(address);

    }
}
